/*
 * Functor.h
 *
 *  Created on: 20/nov/2010
 *      Author: computer
 */

#ifndef FUNCTOR_H_
#define FUNCTOR_H_
#include "Expression.h"
#include "FlowExpression.h"

namespace TreeExpression {

//This class define a functor, i.e. the general utility for create a function
class Functor : public virtual FlowExpression {
public:
	Functor(const std::string&);
	Functor(const Functor&);
	virtual ~Functor();

	int match(const AutoPointer<Expression>&);

	void addPattern(const Pattern<>&);
	std::list< Pattern<> > getPattern() const;
	void setPattern(const std::list< Pattern<> >&);

	virtual std::string getHash() const;
	virtual std::string toString() const;
	virtual std::string getName() const;

	bool equal(Functor*) const;
private:
	std::list< Pattern<> > listPattern;
	std::string nameFunctor;
};

}

#endif /* FUNCTOR_H_ */
